<template>

    <div style="min-height: 100vh">

        <!-- 导航栏 -->

        <div class="hotel-list-bg d-flex align-items-center justify-content-center position-relative">
            <img src="../assets/images/hotel-list-bg.png" alt="" />
        </div>
        <el-descriptions class="margin-top" title="房屋详情" :column="3" :size="size">
            <template slot="extra">
                <el-button type="primary" size="small">操作</el-button>
            </template>
            <el-descriptions-item label="几栋">{{formData.building}}</el-descriptions-item>
            <el-descriptions-item label="楼层">{{formData.floor}}</el-descriptions-item>
            <el-descriptions-item label="房间名">{{formData.name}}</el-descriptions-item>
            <el-descriptions-item label="入住时间">{{formData.inTime}}</el-descriptions-item>
            <el-descriptions-item label="房间大小">{{formData.roomSize}}</el-descriptions-item>
            <el-descriptions-item label="描述">{{formData.description}}</el-descriptions-item>
            <el-descriptions-item label="水总量">{{formData.water}}</el-descriptions-item>
            <el-descriptions-item label="电总量">{{formData.electricity}}</el-descriptions-item>
            <el-descriptions-item label="物业费">{{formData.managementFee}}</el-descriptions-item>
        </el-descriptions>

    </div>
</template>

<script>
    import { get, post } from "../utils/request";
    export default {
        name: "MyRoom",
        components: {
        },
        data(){
            return {
                size:"50",
                roomId:'',
                formData:{
                    building:'',
                    description:'',
                    floor:'',
                    electricity:'',
                    inTime:'',
                    managementFee:'',
                    name:'',
                    roomSize:'',
                    status:'',
                    water:""
                }
        }},
        mounted() {
            this.getRoom()
        },
        methods:{
            getRoom(){
                let userId=localStorage.getItem("userId");
                get('/api/user/get/' + userId)
                    .then(res => {
                        this.roomId=res.data.data.roomId
                        get('/api/room/get/' + this.roomId)
                            .then(res => {
                                this.formData= res.data.data
                                console.log("form",this.formData)
                            })
                            .catch(err => {
                                console.log(err);
                            })
                    })
                    .catch(err => {
                        console.log(err);
                    })

            }


        }

    };
</script>

<style scoped>
    .record-list-main {
        height: calc(100vh - 220px);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background-color: #ecf5ff;
    }

    .t-nav {
        width: 100%;
        height: 68px;
        background: #fff;
        opacity: 0.8;
        z-index: 999;
        position: fixed;
        top: 0;
        left: 0;
    }

    .nav-content {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 100%;
    }

    .nav-content ul {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .nav-content li {
        font-size: 18px;
        margin: 0 30px;
    }

    .nav-bt {
        width: 123px;
        height: 34px;
        line-height: 34px;
        background: #28b535;
        border-radius: 16px;
        border: 0;
        color: #fff;
    }

    .nav-content a {
        color: #a1a09e;
    }

    .nav-content a:hover {
        color: #323230;
    }

    .hotel-list-bg {
        width: 100%;
        height: 220px;
    }

    .hotel-list-bg img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 220px;
    }

    .hotel-list-bg h3 {
        margin-bottom: 25px;
        font-size: 36px;
        font-weight: 400;
        color: #ffffff;
    }

    .hotel-list-content {
        display: flex;
        justify-content: center;
        padding-top: 30px;
    }

    .hotel-list {
    }

    .hotel-list li {
        display: flex;
        margin-bottom: 30px;
    }

    .hotel-list li .li-l {
        width: 370px;
        height: 423px;
        margin: 0px 30px;
    }

    .hotel-list li .li-l img {
        width: 100%;
        height: 100%;
    }

    .hotel-list li .li-r {
        width: 360px;
        margin: 0px 30px;
        position: relative;
    }

    .hotel-list li .li-r h4 {
        font-size: 36px;
        margin-bottom: 15px;
        font-weight: 400;
    }

    .hotel-list li .li-r h6 {
        font-size: 14px;
        margin-bottom: 28px;
        font-weight: 400;
    }

    .hotel-list li .li-r div {
        font-size: 15px;
        color: #898989;
        margin-bottom: 20px;
        overflow: auto;
        max-height: 206px;
    }

    .hotel-list li .li-r button {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 118px;
        height: 38px;
        line-height: 38px;
        background: #e1bd85;
        font-size: 12px;
        color: #ffffff;
        border-radius: 5px;
        border: none;
    }



</style>
